package org.smile.design.adaptor.object;

public class Iphone<T> {
    public void chargeIphone(Lighting lighting) {
        System.out.println(this.getClass().getSimpleName() + " use lighting to charge");
        lighting.chargeIphone();
    }

    public void charge(T t) {
        if (t instanceof Lighting) {
            chargeIphone((Lighting) t);
        } else {
            System.out.println("can't charge");
        }
    }
}
